// 封装患者相关接口
import type { PatientItem, PatientParams } from '@/types/patient'
import { request } from '@/utils/http'

/**
 * 添加患者（家庭档案）
 */
export const addPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}

/**
 * 获取患者（家庭档案）列表
 */
export const patientListApi = () => {
  return request.get<null, PatientItem[]>('/patient/mylist')
}

export const deletePatientApi = (id: string) => {
  // 删除是个操作  动作   这件事做完就行
  return request.delete(`/patient/del/${id}`)
}

export const getPatientDetailApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}

export const updatePatientApi = (form: PatientItem) => {
  return request.put('/patient/update', form)
}
